﻿<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="~/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/assets/css/font-awesome.min.css" />

    <link rel="stylesheet" href="~/assets/css/ace.min.css" />
    <link rel="stylesheet" href="~/assets/css/ace-rtl.min.css" />
    <link rel="stylesheet" href="~/assets/css/ace-skins.min.css" />
    <link rel="stylesheet" href="~/css/style.css" />

    <script src="~/assets/js/ace-extra.min.js"></script>

    
    <script src="~/Scripts/jquery-3.3.1.js"></script>
    <script src="~/assets/layer/layer.js" type="text/javascript"></script>
    <title>登录</title>
</head>
<body class="login-layout Reg_log_style">
    <div class="logintop">
        <span>欢迎后台管理界面平台</span>
        <ul>
            <li><a href="~/#">返回首页</a></li>
            <li><a href="~/#">帮助</a></li>
            <li><a href="~/#">关于</a></li>
        </ul>
    </div>
    <div class="loginbody">
        <div class="login-container">
            <div class="center">
                
            </div>

            <div class="space-6"></div>

            <div class="position-relative">
                <div id="login-box" class="login-box widget-box no-border visible">
                    <div class="widget-body">
                        <div class="widget-main">
                            <h4 class="header blue lighter bigger">
                                <i class="icon-coffee green"></i>
                                管理员登录
                            </h4>

                            <div class="login_icon"></div>

                            <form class="">
                                <fieldset>
                                    <ul>
                                        @if (ViewBag.AdminName != null && ViewBag.AdminPwd != null)
                                        {
                                            <li class="frame_style form_error"><label class="user_icon"></label><input name="用户名" type="text" id="username" value="@ViewBag.AdminName" /><i></i></li>
                                            <li class="frame_style form_error"><label class="password_icon"></label><input name="密码" type="password" id="userpwd" value="@ViewBag.AdminPwd" /><i></i></li>
                                        }
                                        else
                                        {
                                            <li class="frame_style form_error"><label class="user_icon"></label><input name="用户名" type="text" id="username" /><i></i></li>
                                            <li class="frame_style form_error"><label class="password_icon"></label><input name="密码" type="password" id="userpwd" /><i></i></li>
                                        }

                                    </ul>
                                    <div class="space"></div>

                                    <div class="clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">保存密码</span>
                                        </label>

                                        <button type="button" class="width-35 pull-right btn btn-sm btn-primary" id="login_btn">
                                            <i class="icon-key"></i>
                                            登录
                                        </button>
                                    </div>

                                    <div class="space-4"></div>
                                </fieldset>
                            </form>

                            <div class="social-or-login center">
                                <span class="bigger-110">通知</span>
                            </div>

                            <div class="social-login center">
                                本网站系统不再对IE8以下浏览器支持，请见谅。
                            </div>
                        </div><!-- /widget-main -->

                        <div class="toolbar clearfix">
                        </div>
                    </div><!-- /widget-body -->
                </div><!-- /login-box -->
            </div><!-- /position-relative -->
        </div>
    </div>
    <div class="loginbm">版权所有  2016  <a href="~/">南京思美软件系统有限公司</a> </div><strong></strong>
</body>

</html>
<script>
    var DC = false;
    $('.ace').on('click', function () {
        if (DC == false) {
            DC = true;
        }
        else if (DC == true) {
            DC = false;
        }
    });
    $('#login_btn').on('click', function () {
        var user = {};
        user.UserName = $("#username").val();
        user.Pwd = $("#userpwd").val();
        $.ajax({
            type: "post",
            url: "/Login/LoginInfo?DC=" + DC,
            data: user,
            success: function (result) {
                if (result.Success) {
                    window.location.href = "/Home/Index";
                } else {
                    alert("账号密码错误！");
                }
            },
        })
    });
</script>
